package com.painpointcloud.common.util.web;

import com.painpointcloud.common.util.core.BaseBean;
import com.painpointcloud.common.util.core.Page;
import java.util.List;
/**
 * Created by JackLeon on 2017/8/25 6:46
 * description:控制器基类
 **/
public class BaseController {
	/**
	 * 封装Page信息
	 * @param param
	 * @param list
	 * @param count
	 * @return
	 */
	protected Page getPageInfo(BaseBean param,List list,Long count){
		Page page = new Page(param.getCurrentPage(),param.getPageSize(),count, list);
		return page;
	}

	/**
	 * 设置分页参数
	 * @param param
	 * @return
	 */
	protected  BaseBean setPageParam(BaseBean param){
		param.setStartIndex(param.getStartIndex());
		param.setEndIndex(param.getEndIndex());
		return param;
	}
}
